﻿using System.Collections.Generic;
using UnityEngine;

public class SlimePurposeSystem : PurposeSystem
{
    public override List<Purpose> purposeList { get; } = new List<Purpose>
    {
        new AttackPurpose() {  attackAmount = 2 },
        new AttackPurpose() {  attackAmount = 3 },
        new AttackPurpose() { attackAmount = 4 },
    };

    public void Update()
    {
        if (systemEnemyView == null) return;

        float hpRatio = (float)systemEnemyView.CurrentHealth / systemEnemyView.MaxHealth;

        if (hpRatio <= 0.5f && !(nowPurpose is SlimeSplitPurpose))
        {
            SetPurpose(new SlimeSplitPurpose() { enemyView = systemEnemyView, splitCount = 2 });
        }
     
    }


}
